﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PJ.Data.Partner
{
    [Serializable]
    [DataContract]
    public abstract class BasePartnerData : BaseItemData, IPartnerData
    {
        private string m_Phone;
        private string m_Address;

        [DataMember]
        public string Phone
        {
            get { return m_Phone; }
            set { m_Phone = value; }
        }

        [DataMember]
        public string Address
        {
            get { return m_Address; }
            set { m_Address = value; }
        }
        protected BasePartnerData()
        {
        }
        protected BasePartnerData(IPartnerData data)
            : base(data)
        {
        }
        public override IObjectData Copy(IObjectData data)
        {
            base.Copy(data);
            IPartnerData partner = (IPartnerData)data;
            this.Phone = partner.Phone;
            this.Address = partner.Address;
            return this;
        }
        public override bool IsEqual(IObjectData data)
        {
            if (base.IsEqual(data))
            {
                IPartnerData partner = (IPartnerData)data;
                if (partner.Address == this.Address)
                    if (partner.Phone == this.Phone)
                        return true;
            }
            return false;
        }

    }
}
